package com.axjy.service.impl;


import com.axjy.dto.InspectiontaskDetailDto;
import com.axjy.dto.InspectiontaskMainDto;
import com.axjy.mapper.InspectiontaskDetailMapper;
import com.axjy.pojo.InspectiontaskDetail;
import com.axjy.pojo.InspectiontaskMain;
import com.axjy.pojo.LineInfo;
import com.axjy.pojo.Systemconfig;
import com.axjy.service.InspectiontaskDetailService;
import com.axjy.service.vo.Pager;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 00 on 2018/2/3.
 */
@Service("InspectiontaskDetailServiceimpl")
@Transactional
public class InspectiontaskDetailServiceimpl implements InspectiontaskDetailService {
    @Resource
    private InspectiontaskDetailMapper mapper;

    @Override
    public List<Systemconfig> search2() {
        return mapper.search2();
    }

    @Override
    public List<Systemconfig> search1() {
        return mapper.search1();
    }

    @Transactional(readOnly = true)
    @Override
    public Pager djqrshow(Integer offset, Integer limit, InspectiontaskDetailDto inspectiontaskDetailDto) {
        Pager p=new Pager();
        p.setRows(mapper.djqrshow(offset, limit, inspectiontaskDetailDto));
        p.setTotal(mapper.getCount(inspectiontaskDetailDto));
        return p;
    }

    @Override
    public Pager zxshow(Integer offset, Integer limit, InspectiontaskMainDto dto) {
        Pager pager=new Pager();
        pager.setRows(mapper.zxshow(offset, limit, dto));
        pager.setTotal(mapper.getCount2(dto));
        return pager;
    }

    @Override
    public Pager qxshow(Integer offset, Integer limit, InspectiontaskMainDto dto) {
        Pager pager=new Pager();
        pager.setRows(mapper.qxshow(offset, limit, dto));
        pager.setTotal(mapper.getCount3(dto));
        return pager;
    }

    @Override
    public List<LineInfo> search(String lineCode) {
        return mapper.search(lineCode);
    }

    @Override
    public List<InspectiontaskDetail> getByCode(String configCode) {
        return mapper.getByCode(configCode);
    }

    @Override
    public void hzupdate(InspectiontaskDetail inspectiontaskDetail) {
        mapper.hzupdate(inspectiontaskDetail);
    }

    @Override
    public void zxupdate(Integer id) {
        mapper.zxupdate(id);
    }

    @Override
    public void hzwcupdate(Integer taskId) {
        mapper.hzwcupdate(taskId);
    }
}
